/*
 * Copyright (c) 2021 Talkweb Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef _TW_NFC_KITS_H
#define _TW_NFC_KITS_H
#include "tw_nfc.h"

/**
* 特别注意:
* 此工具包暂时只支持以下ndef格式:
* 1. 单个ndef record数据payload长度最大只支持256byte(默认为256byte)，可在tw_nfc_ndef.h中修改定义
* 2. 只支持标准RTD格式中的UTF8数据格式和URI数据格式
* 3. 不支持带ID的ndef包格式 
*/

/**
 * @brief NFC芯片I2C接口初始化
 */
extern void TWNfcI2cInit(void);

/**
 * @brief 写NFC标签函数
 * @param param 待写入的NFC标签信息
 * @param tagCnt 待写入的NFC标签个数
 * @return 返回TRUE表示写入NFC标签成功
 */
extern BOOL TWNfcTagWrite(NdefFrame *param, unsigned char tagCnt);

/**
 * @brief 读NFC标签函数
 * @return 返回读取到的NFC标签链表头
 */
extern NdefParsingList *TWNfcTagRead(void);

/**
 * @brief 读NFC标签释放函数
 * @param list 待释放的NFC标签链表头
 */
extern void NfcReadTagFree(NdefParsingList *list);

#endif
